import Axios from 'axios';

browser.runtime.onMessage.addListener(function(request, sender, sendResponse) {
  chrome.cookies
    .get({
      url: 'https://htl-8g27ywr75a8f30da-1253452334.tcloudbaseapp.com/',
      name: 'name'
    })
    .then(res => {
      console.log(res, '-----');
    });
  const { type, url, data, apiMethod } = request;
  if (type === 'axios') {
    return Axios({
      method: apiMethod,
      url,
      data
    });
  }

  /*   axios.get(`http://45.125.47.99:3100/v1/goods/1`).then((res)=>{
    console.log(res)
  })
 */
});
